﻿using System;

namespace Ops.Mpc.ValidationServices.Attributes
{
    public abstract class ValidationAttribute : Attribute, IValidationAttribute
    {
        public ValidationAttribute()
        {
            this.MessageId = string.Empty;
        }

        #region IValidationAttribute Members


        public virtual bool Validate(object container, object data, string[] propertyNames)
        {
            return false;
        }

        public string MessageId
        {
            set;
            get;

        }

        public string Message
        {
            get;
            set;
        }

        public virtual string FormatMessage(string messageFormat, object container, object data, string name)
        {
            return messageFormat;
        }

        #endregion
    }
}
